import App from "./App";
import store from "@/store";

import "$utils/noScale"

import {
  router,
  RouterMount
} from "./router/index.js";

Vue.use(router);
// #ifndef VUE3
import Vue from "vue";
Vue.config.productionTip = false;
App.mpType = "app";

// 如此配置即可
// uni.$u.config.unit = 'rpx'
// vuex
const vuexStore = require("@/store/$u.mixin.js");
Vue.mixin(vuexStore);

// // 权限
// import hasPermission from "@/directive/permission";
// Vue.use(hasPermission);

// 去去除console.log()
if (process.env.NODE_ENV !== "development") {
  console.log = () => { }
}

// 监听主题变化
import theme from "./theme/cue-theme.js"
Vue.use(theme)

// 监听全局消息
import message from "./common/mixins/message"
Vue.use(message)

import basicColor from "@/style/_variables.js";

Vue.prototype.$basicColor = basicColor;

const app = new Vue({
  store,
  ...App
});
// #endif

// #ifdef VUE3
import {
  createSSRApp
} from "vue";
export function createApp() {
  const app = createSSRApp(App);
  return {
    app
  };
}

// #endif
require("./config/request.js")(app);
// // 引入请求封装，将app参数传递到配置中

import uView from "uview-ui";
Vue.use(uView);

// v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, "#app");

// #endif

// #ifndef H5
app.$mount(); // 为了兼容小程序及app端必须这样写才有效果
// #endif
import "./permission";
